# Active scene - is a special global variable which contains all system reserved routines
ActiveScene.systemInitialize = function ()
	ActiveScene.handlers = {

		guiGameStart = function ()
			Player.New();
			Game.SetScene('level');
		end;
		
		guiGameLoad = function ()
			GUI.Panel('LoadMenu_panel'):ShowModal();
		end;
		
		guiGameLoad_OK = function ()
			--local loadListItem = GUI.Panel('LoadMenu_panel'):Element('LoadList'):Item();
			--if loadListItem ~= '' then
			--	Player.Load(loadListItem);
				Player.Load('test');
				Game.SetScene('level');
				GUI.Unmodal(0); -- modal result OK
			--end
			
		end;
		
		guiGameLoad_Cancel = function ()
			GUI.Unmodal(1); -- modal result Cancel
		end;
		
		guiSettingsStart = function ()
			GUI.Panel('SettingsMenu_panel'):ShowModal();
		end;

	};

	-- Some shortcuts
	guiGameStart = ActiveScene.handlers.guiGameStart;
	guiGameLoad = ActiveScene.handlers.guiGameLoad;
	guiGameLoad_OK = ActiveScene.handlers.guiGameLoad_OK;
	guiGameLoad_Cancel = ActiveScene.handlers.guiGameLoad_Cancel;
	guiSettingsStart = ActiveScene.handlers.guiSettingsStart;

end

ActiveScene.systemFinalize = function ()
	-- Clear container
	ActiveScene.handlers = nil;
		-- Scene unique handlers
		-- ...

	-- Clear shortcuts
	guiGameStart = nil;
	guiGameLoad = nil;
	guiGameLoad_OK = nil;
	guiGameLoad_Cancel = nil;
	guiSettingsStart = nil;

end